!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("rb_wixui.thunderbolt[HeaderContainer_AfterScroll]",["react"],t):"object"==typeof exports?exports["rb_wixui.thunderbolt[HeaderContainer_AfterScroll]"]=t(require("react")):e["rb_wixui.thunderbolt[HeaderContainer_AfterScroll]"]=t(e.React)}("undefined"!=typeof self?self:this,(function(e){return function(){var t={96114:function(e,t,n){var r;!function(t){"use strict";var o=function(){},i=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(e){return setTimeout(e,16)};function s(){var e=this;e.reads=[],e.writes=[],e.raf=i.bind(t),o("initialized",e)}function a(e){e.scheduled||(e.scheduled=!0,e.raf(d.bind(null,e)),o("flush scheduled"))}function d(e){o("flush");var t,n=e.writes,r=e.reads;try{o("flushing reads",r.length),e.runTasks(r),o("flushing writes",n.length),e.runTasks(n)}catch(e){t=e}if(e.scheduled=!1,(r.length||n.length)&&a(e),t){if(o("task errored",t.message),!e.catch)throw t;e.catch(t)}}function l(e,t){var n=e.indexOf(t);return!!~n&&!!e.splice(n,1)}s.prototype={constructor:s,runTasks:function(e){var t;for(o("run tasks");t=e.shift();)t()},measure:function(e,t){o("measure");var n=t?e.bind(t):e;return this.reads.push(n),a(this),n},mutate:function(e,t){o("mutate");var n=t?e.bind(t):e;return this.writes.push(n),a(this),n},clear:function(e){return o("clear",e),l(this.reads,e)||l(this.writes,e)},extend:function(e){if(o("extend",e),"object"!=typeof e)throw new Error("expected object");var t=Object.create(this);return function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}(t,e),t.fastdom=this,t.initialize&&t.initialize(),t},catch:null};var c=t.fastdom=t.fastdom||new s;void 0===(r=function(){return c}.call(c,n,c,e))||(e.exports=r)}("undefined"!=typeof window?window:void 0!==this?this:globalThis)},5329:function(t){"use strict";t.exports=e},448:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{id:n,className:r,skinClassName:o,tagName:s="div",transition:d,transitionEnded:l,eventHandlers:c,skinStyles:u,children:f,tabIndex:p}=e;const m=s;return i().createElement(m,t()({id:n,className:a(o,d&&u[d],l&&u.transitionEnded,r),tabIndex:p},c),f)},l=r(96114),c=r.n(l);const u=()=>"undefined"!=typeof window;function f(){if(!u())return{x:0,y:0,isAtPageBottom:!1};const{left:e,top:t}=document.body.getBoundingClientRect();return{x:e,y:t,isAtPageBottom:window.innerHeight+window.scrollY===document.body.scrollHeight}}function p(e,t,r){void 0===r&&(r={}),r={waitFor:100,disabled:!1,...r};const o=(0,n.useRef)(f());let i=null;const s=()=>{c().measure((()=>{const t=f(),n=o.current;o.current=t,i=null,c().mutate((()=>e({prevPos:n,currPos:t})))}))};(u()?n.useLayoutEffect:n.useEffect)((()=>{if(!u())return;const e=()=>{null===i&&(i=window.setTimeout(s,r.waitFor))};return r.disabled?()=>{}:(window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e),i&&window.clearTimeout(i)})}),t)}var m={screenWidthBackground:"PVTOEq",HeaderHideToTop:"JbQvCF",headerHideToTop:"JbQvCF",HeaderHideToTopReverse:"LvGYRg",headerHideToTopReverse:"LvGYRg",HeaderFadeOut:"_C88Up",headerFadeOut:"_C88Up",transitionEnded:"RLRBWe",HeaderFadeOutReverse:"DPp8M_",headerFadeOutReverse:"DPp8M_",inlineContent:"Ze1d3J",centeredContent:"E2Gu_X",centeredContentBg:"ql53Bl",AfterScroll:"tcsOnZ",afterScroll:"tcsOnZ",scrolled:"vkyGBO"};var h=e=>{let{wrapperProps:r,children:o}=e;const[i,s]=n.useState(!1);return p((e=>{let{currPos:t}=e;-1*t.y>=2?i||s(!0):i&&s(!1)}),[i]),n.createElement(d,t()({},r,{skinClassName:m.AfterScroll,skinStyles:m}),n.createElement("div",{className:a(m.screenWidthBackground,i&&m.scrolled)}),n.createElement("div",null,n.createElement("div",null,o)))};const v="wixui-",w=(e,...t)=>{const n=[];return e&&n.push(`${v}${e}`),t.forEach((e=>{e&&(n.push(`${v}${e}`),n.push(e))})),n.join(" ")},y="mesh-container-content",b="inline-content",g=e=>i().createElement("div",{key:e.props.id+"-rotated-wrapper","data-mesh-id":e.props.id+"-rotated-wrapper"},e),x=(e,n)=>{const{id:r,className:o,wedges:s=[],rotatedComponents:d=[],children:l,fixedComponents:c=[],extraClassName:u="",renderRotatedComponents:f=g}=e,p=i().Children.toArray(l()),m=[],h=[];p.forEach((e=>c.includes(e.props.id)?m.push(e):h.push(e)));const v=(e=>{const{wedges:t,rotatedComponents:n,childrenArray:r,renderRotatedComponents:o}=e,s=n.reduce(((e,t)=>({...e,[t]:!0})),{});return[...r.map((e=>{return s[(t=e,t.props.id.split("__")[0])]?o(e):e;var t})),...t.map((e=>i().createElement("div",{key:e,"data-mesh-id":e})))]})({childrenArray:h,rotatedComponents:d,wedges:s,renderRotatedComponents:f});return i().createElement("div",t()({},(e=>Object.entries(e).reduce(((e,[t,n])=>(t.includes("data-")&&(e[t]=n),e)),{}))(e),{"data-mesh-id":r+"inlineContent","data-testid":b,className:a(o,u),ref:n}),i().createElement("div",{"data-mesh-id":r+"inlineContent-gridContainer","data-testid":y},v),m)};var C=i().forwardRef(x);var E={root:"header"};const T="Reverse",k="up",H="down";var O=e=>{const{id:r,skin:o,children:s,animations:d,meshProps:l,className:c,customClassNames:u=[],fillLayers:f}=e,[m,h]=(0,n.useState)(""),[v,y]=(0,n.useState)(!1),b=e=>{h(e),y(!1)};(0,n.useEffect)((()=>{window.TransitionEvent||setTimeout((()=>y(!0)),200)}),[m]);const g=m&&!(e=>e.endsWith(T))(m),x=()=>{const e=(e=>""+e+T)(m);b(e)},O={onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onClick:e.onClick,onDoubleClick:e.onDblClick,onFocus:g?x:void 0,onTransitionEnd:()=>y(!0)};let P=H,_=0;p((e=>{var t,n;let{currPos:r,prevPos:o}=e;const i=r.y&&-1*r.y,s=o.y&&-1*o.y,a=d[d.length-1],l=null==(t=a.params)||null==(t=t.animations)?void 0:t[a.params.animations.length-1];if(!l)return;const c="mobile"===(null==(n=a.viewMode)?void 0:n.toLowerCase())?1:(e=>{switch(e){case"HeaderFadeOut":return 200;case"HeaderHideToTop":return 400;default:return null}})(l.name);c&&(((e,t)=>{P===H&&et&&e>=0&&t>=0&&(_=t,P=H)})(i,s),g?(P===k&&i+c<_||0===r.y)&&x():P===H&&i-_>=c&&b(l.name))}),[m,d],{disabled:!d||!d.length});const S=a(c,w(E.root,...u));return i().createElement(o,{wrapperProps:{id:r,tagName:"header",eventHandlers:O,className:S,transition:m,transitionEnded:v,tabIndex:"-1"},"data-block-level-container":"HeaderContainer",fillLayers:f},i().createElement(C,t()({id:r},l,{children:s})))};const P=e=>e.replace(/([A-Z])/g,(e=>`-${e.toLowerCase()}`));var _;const S={HeaderContainer_AfterScroll:{component:e=>i().createElement(O,t()({},e,{skin:h})),controller:(_=e=>{let{mapperProps:t,controllerUtils:r}=e;const{updateStyles:o}=r,{compId:i,marginTop:s,isMobileView:a,isFixed:d,...l}=t;var c;return c=()=>{var e;const t=((null==(e=window.document.getElementById(i))?void 0:e.clientHeight)||0)>=window.document.body.clientHeight/2;a&&d&&t&&o({position:"relative !important",marginTop:s,top:0})},(0,n.useEffect)(c,[]),l},{useComponentProps:(e,t,n)=>{const r=(e=>({...e,updateStyles:t=>{const n=Object.entries(t).reduce(((e,[t,n])=>{return{...e,[(r=t,r.startsWith("--")?t:P(t))]:void 0===n?null:n};var r}),{});e.updateStyles(n)}}))(n);return _({mapperProps:e,stateValues:t,controllerUtils:r})}})}}}(),o}()})); //# sourceMappingURL=https://static.parastorage.com/services/editor-elements-library/dist/thunderbolt/rb_wixui.thunderbolt[HeaderContainer_AfterScroll].420507ad.bundle.min.js.map